package cn.dgut.training.mapper;

import cn.dgut.training.entity.activity.Coupon;
import cn.dgut.training.entity.activity.CouponUser;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface CouponUserMapper extends BaseMapper<CouponUser> {

    @Select("select c.* from coupon c,coupon_user cu where cu.user_id=#{userId} and cu.coupon_id=c.id and cu.status=#{status}")
    public List<Coupon> mylist(@Param("userId") Long userId, @Param("status") Integer status, IPage page);
}
